package com.zxc.demo4.advice;

import org.springframework.aop.ThrowsAdvice;

import java.lang.reflect.Method;
import java.util.Date;



/**
  * @author: zxc
  * @return:
  * @time:  2021/5/17 18:48
  * @description: 异常增强
  */
public class ExceptionAdvice implements ThrowsAdvice {
    public void afterThrowing(Method method, Object[] args, Object target, Exception ex){
        System.out.print("异常日志记录"+new Date()+",出现异常的类是"+method.getName());
        System.out.println(",异常信息是"+ex.getMessage());
    }
}
